package com.itheima.reggie.service;

import com.itheima.reggie.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ShoppingCartService {

    /**
     * 添加购物车
     * @param shoppingCart 购物车对象
     * @return Boolean
     */
    ShoppingCart add(ShoppingCart shoppingCart);

    /**
     * 减少购物车数量
     * @param shoppingCart 购物车对象
     * @return Boolean
     */
    ShoppingCart decreaseNumber(ShoppingCart shoppingCart);

    /**
     * 查询购物车列表：
     * @param userId
     * @return
     */
    List<ShoppingCart> findShoppingCartListByUserId(Long userId);


    /**
     * 根据用户id清空购物车
     * @param userId
     * @return
     */
    Integer delete(Long userId);

}
